<template>
  <div class="dashboard-container">
    <div class="dashboard-text">牙医辅助治疗</div>
    <el-upload
      class="upload-demo"
      action="https://jsonplaceholder.typicode.com/posts/"
      :on-preview="handlePreview"
      :on-remove="handleRemove"
      :file-list="fileList"
      list-type="picture"
      multiple
    >
      <el-button size="small" type="primary">点击上传</el-button>
      <div slot="tip" class="el-upload__tip">
        只能上传jpg/png文件，且不超过500kb
      </div>
    </el-upload>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  name: "Dashboard",
  computed: {},
  data() {
    return {
      fileList: [
        {
          name: "A-1.png",
          url: "http://cdn.huyinfu.space//tooth_img/result/A-1.png",
        },
        {
          name: "A-1_mask.png",
          url: "http://cdn.huyinfu.space//tooth_img/result/A-1_mask.png",
        },
      ],
    };
  },
  methods: {
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      this.fileList.push(file);
      console.log(file);
    },
  },
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
